ListAdapter
object WordsDiffCallback : DiffUtil.ItemCallback<Word>() {
override fun areItemsTheSame(oldItem: Word, newItem: Word) =
override fun areContentsTheSame(oldItem: Word, newItem: Word) =
}
class WordListAdapter : ListAdapter<Word, WordListAdapter.WordViewHolder>(WordsDiffCallback) {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WordViewHolder {...}
override fun onBindViewHolder(holder: WordViewHolder, position: Int) {...}
}
val myAdapter = WordListAdapter()
recyclerView.adapter = myAdapter
myAdapter.submitList(listOf("word#1", "word #2"))